package com.qianli.cashmama.trade.domain.factory;

import com.qianli.cashmama.trade.client.bill.request.BillPayRequest;
import com.qianli.cashmama.trade.domain.model.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/24
 * Time: 上午10:51
 */
public interface BillBaseDomainFactory {
    /**
     * 创建账单
     *
     * @param tradeBase
     * @param receivedDate
     * @return
     */
    List<BillBase> composeBillBase(TradeBase tradeBase, Date receivedDate);

    /**
     * 更新账单信息
     *
     * @param
     * @param billPayRequest
     */
    void composeBillBaseForRepayment(BillBase billBase, TradeBase tradeBase, BillPayRequest billPayRequest, BigDecimal discountCapital);


    /**
     * 记录还款现金流水
     *
     * @param billPayRequest
     * @param userCode
     * @return
     */
    TradeBillDetail composeBillDetail(BillBase billBase, BillPayRequest billPayRequest, String userCode);

    /**
     * 做还款记账会计分录
     *
     * @param tradeBillDetail
     * @param billBase
     * @param billPayRequest
     * @param discountCapital
     * @return
     */
    TradeRepaymentAccounting composeBillRepaymentAccounting(TradeBillDetail tradeBillDetail, BillBase billBase, BillPayRequest billPayRequest, BigDecimal discountCapital);

    /**
     * 做还款记账会计分录
     *
     * @param billRepaymentAccountingList
     * @param billBase
     * @param tradeBase
     * @param billPayRequest
     * @return
     */
    BillAccounting composeBillAccounting(List<BillAccounting> billRepaymentAccountingList, BillBase billBase, TradeBase tradeBase, BillPayRequest billPayRequest, TradeBillDetail tradeBillDetail);
}
